UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q1UEyyrwzRShbaiRKlf2x1dfarpCLSxz02hPA6VDuiQ='
WHERE
key_id = 'ef9e8797a188082db1f4bd5797722a3d91092abdf68b3dd9d78b0da72375d26e'
AND (
token = 'q1UEyyrwzRShbaiRKlf2x1dfarpCLSxz02hPA6VDuiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)