UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0JWev5UCpLAouMMNzf8XuLuPZTJcOaCG//SJO7k1vH0='
WHERE
key_id = 'd9d706f2810447769799bfc63366318e2228674fdce9511667e0241eecfabcf1'
AND (
token = '0JWev5UCpLAouMMNzf8XuLuPZTJcOaCG//SJO7k1vH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)