UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LwQGB2Op68lbMfvQDWzq59ApIIgIACrkW2rJ/tHLC18='
WHERE
key_id = 'a7285d8e1edad2a2ca131580d5011f50c34120ef0d4f91ebbcf2d8c5697afa42'
AND (
token = 'LwQGB2Op68lbMfvQDWzq59ApIIgIACrkW2rJ/tHLC18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)