UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+mbL0fGwzZ8ARm4mb0eloAkK0TTZHyP8hap+3hwzGHg='
WHERE
key_id = '8b07c6753b250165bac6f3f27a67029a94bd988302f3dbf3a3100b33a699f5d7'
AND (
token = '+mbL0fGwzZ8ARm4mb0eloAkK0TTZHyP8hap+3hwzGHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)