UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43CyEb2x/THHYkCwQ9OcK6tOtvbJ4xlEYR9tmDJMSM4='
WHERE
key_id = '3e8c4b74404b223984a9e286c9d33bab6c94d7e54f6d949a9c70507ed8fbb38b'
AND (
token = '43CyEb2x/THHYkCwQ9OcK6tOtvbJ4xlEYR9tmDJMSM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)