UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2umUoWqvgQ27Aym/UxiSEwCnkiOae5Hcon61R6jDqc='
WHERE
key_id = '9ccd0a828683c27daa4ac86fe88dd0c5d39cd91e540286fc825d0b4412a8321a'
AND (
token = 's2umUoWqvgQ27Aym/UxiSEwCnkiOae5Hcon61R6jDqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)