UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ptf3reMwCq0SOgeGKfMf1k5jFh7RtCOjVY8k5wl/8MM='
WHERE
key_id = '5267f4605ca59994f1f85e23535dd1a556888c885530dc7662b49300c6868670'
AND (
token = 'Ptf3reMwCq0SOgeGKfMf1k5jFh7RtCOjVY8k5wl/8MM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)