UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4XLI1ah+kNIRyr2s2QmCI3iKKpdrD72KCn55ehlB5rM='
WHERE
key_id = '5b6a06689e96bf5120abdc16d4792f0f120ee427fb5fe6785f2ceb103ef396db'
AND (
token = '4XLI1ah+kNIRyr2s2QmCI3iKKpdrD72KCn55ehlB5rM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)