UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uVnK+8g72QN7uwutOgT3e1dKHR+/ljZBPErm1i+UZJo='
WHERE
key_id = '5cda77d4bb427afb6d5ea6785887199782ce75d47bacc5664a2a176f4bcc45a6'
AND (
token = 'uVnK+8g72QN7uwutOgT3e1dKHR+/ljZBPErm1i+UZJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)