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