UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HNCaCDzyPBGoumS169W5PlasRMETrNfeZ+pAByLe+dw='
WHERE
key_id = '41fb076e94bf10a6e61c51db9d89abd699617b895db19aef528f3494a7b4234f'
AND (
token = 'HNCaCDzyPBGoumS169W5PlasRMETrNfeZ+pAByLe+dw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)