UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Y082mzLLbeYsetS67BfG1dFqB4Rc5/jb32bADaLkv8='
WHERE
key_id = '874b202fd6ea17745011d931245fcbe1741080625ef89c45d8b14cd5dd0947f3'
AND (
token = '1Y082mzLLbeYsetS67BfG1dFqB4Rc5/jb32bADaLkv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)