UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jPaqrLlLoA8wC2ZEV8GZfCM6gKtUfaIkVUtQsIVeQw0='
WHERE
key_id = '8de4bc47c207fafac24daf3c0aff99118e392b2ff6de64a03fb7a31c13f1cbee'
AND (
token = 'jPaqrLlLoA8wC2ZEV8GZfCM6gKtUfaIkVUtQsIVeQw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)