UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CeqPxLxEt7XEyqUX7S4eMw0WkrM9WMjUan+GqaET9e4='
WHERE
key_id = 'f1a083087fb4b5c8f9913a770ead10e89f484ab281d52758da08c7348d55d29f'
AND (
token = 'CeqPxLxEt7XEyqUX7S4eMw0WkrM9WMjUan+GqaET9e4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)