UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QrOcLylivMlB0xhc8TV68OeVBYc+Z8rRDnxPUoZ81qM='
WHERE
key_id = 'f017cfcc3911aa1fdebffcb4fdf6a7f393f8c395dd6553ed1795c3456750a88c'
AND (
token = 'QrOcLylivMlB0xhc8TV68OeVBYc+Z8rRDnxPUoZ81qM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)