UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Dz7p6PzwgRsUFZT2qXg3dy6ynSRBBDdkmtvn4R3VgE='
WHERE
key_id = 'f8ef4d9e94fa2acde83e3ed6d0e1662ce62177ba1a19aaae2a7418440931c9a3'
AND (
token = '5Dz7p6PzwgRsUFZT2qXg3dy6ynSRBBDdkmtvn4R3VgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)