UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJQytrYIgYgOr3SzBWrWiyeXG+W/MO/l4erO7gwVxzo='
WHERE
key_id = '781f19197d63b908b5f4255df0a3a1744adfbadaca776375683e44844a2ef9f8'
AND (
token = 'MJQytrYIgYgOr3SzBWrWiyeXG+W/MO/l4erO7gwVxzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)