UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+SF8936gtT9Fkv7LsVWOrRuD5FZ81MPUPySOUsV65Ds='
WHERE
key_id = '2802369555f912a3bf05674ce8452a6dd525c35a3a159d076ab48c083708474b'
AND (
token = '+SF8936gtT9Fkv7LsVWOrRuD5FZ81MPUPySOUsV65Ds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)