UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7jAeRH7U0oSf/Do58G9VTluZ/Bxk7GpKqecUHuhZ7MQ='
WHERE
key_id = 'cab879ad246a48a980065a48fb0a02dad049762fc45a8a5f97e4d2f56f7c378d'
AND (
token = '7jAeRH7U0oSf/Do58G9VTluZ/Bxk7GpKqecUHuhZ7MQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)