UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cj+5eMcCQaSsZT6PFZ5S5//G/wUmdYv7Z3ZPe9jMn7Q='
WHERE
key_id = '04d411ff5d3f9a2c08d7509b6dd5ca56cf8787f41ec8b283f17ac1383cc3c2ee'
AND (
token = 'Cj+5eMcCQaSsZT6PFZ5S5//G/wUmdYv7Z3ZPe9jMn7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)