UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MRfGn9GPsikU4eCnkCem9vi3aGR2YZpDERoh8j9z7yo='
WHERE
key_id = '8b3a2c68a0bdf42f909c6d4626b8dfd56fd8d0decb16ffe7624f5db4e3d20c1c'
AND (
token = 'MRfGn9GPsikU4eCnkCem9vi3aGR2YZpDERoh8j9z7yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)