UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J0+564k+O1aTGGGY5SJdthZYOchJcoDCSPCpSrLjLFA='
WHERE
key_id = 'd04ac010fe196f0b3c38cf3965f7b67aeb74ca527160c50f247aa2755dff5769'
AND (
token = 'J0+564k+O1aTGGGY5SJdthZYOchJcoDCSPCpSrLjLFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)