UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RoNxO8jNH8ZdMj6/8Lv5VuEnqWx8ceLW/bFHERTpR2Y='
WHERE
key_id = 'fcc981559311b56d2d5c360baf19dead017f969d166e4e8c90631f00a613bae5'
AND (
token = 'RoNxO8jNH8ZdMj6/8Lv5VuEnqWx8ceLW/bFHERTpR2Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)