UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kvxxy7RONzOnEHGfuRF4U0Vs3/dSCQIFKDqtVznTOmA='
WHERE
key_id = '195ea0cb702e471a0976b5000773eeb7dec588c4863231c9b5b5623bb0ef3cfc'
AND (
token = 'kvxxy7RONzOnEHGfuRF4U0Vs3/dSCQIFKDqtVznTOmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)