UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cu6KiMXy8hPFtVXvVGQgEcjZux1wVY+FV3lJJSAL/XI='
WHERE
key_id = '45eea604bece32c3b4ab183335e5867efdc238f5d7bbf96553f726dfc76eddf0'
AND (
token = 'cu6KiMXy8hPFtVXvVGQgEcjZux1wVY+FV3lJJSAL/XI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)