UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5TYsxFtnI6QIh8EEVo6yAlwunqd2iCc7h6sQ2Z7yf3g='
WHERE
key_id = '53898ff17ef110d0cbc562d557a4b99ed02406cf7cedd542666e9c4c9b20c560'
AND (
token = '5TYsxFtnI6QIh8EEVo6yAlwunqd2iCc7h6sQ2Z7yf3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)