UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o1Axxp+NeGgzNjCk5AyJhgsmHxbnuml+/BC8vNtaVvM='
WHERE
key_id = '2535c75c7eccab021417721c01ba58e650b747c421f872d5490ac7890a9b2da1'
AND (
token = 'o1Axxp+NeGgzNjCk5AyJhgsmHxbnuml+/BC8vNtaVvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)