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