UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lNaVbqe4zQzG/v5zG9As5A49hT00K0tGCrprdeVR6/k='
WHERE
key_id = '4ff2ea30d2064e18833ba6e3aa1f476262ad5a44a3db0d722385e58589b201bb'
AND (
token = 'lNaVbqe4zQzG/v5zG9As5A49hT00K0tGCrprdeVR6/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)