UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y07ACfzRmPeshMsHrpEavbk5xvfvYrfxFzvWfi0P3LM='
WHERE
key_id = '73d3fb5d3fd93f1135c6de763109210eee852d1143491e04002aeaf1f049ed68'
AND (
token = 'Y07ACfzRmPeshMsHrpEavbk5xvfvYrfxFzvWfi0P3LM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)