UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e4f0Lql/c/JXUo1NGzMQc2qKmBFcD1KRyxQRqSGoA0M='
WHERE
key_id = 'd90c4c02fe306b9797cf63fe8263a352368dd04f15bf4be2d9dae92638905bc7'
AND (
token = 'e4f0Lql/c/JXUo1NGzMQc2qKmBFcD1KRyxQRqSGoA0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)