UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0YxJrgfzeZSoc777An3/PTFoLEm6PtsOuXAHiqzl0cc='
WHERE
key_id = '9f924aadfd2e5de007a2603a49ad1990d4293ff701ca896b8be29f791f739d06'
AND (
token = '0YxJrgfzeZSoc777An3/PTFoLEm6PtsOuXAHiqzl0cc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)