UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AUJ036wc/KNMZU4QbIkNufnNCH1h3zB2z47tCgQcNuk='
WHERE
key_id = 'ec0b25173337e8858702208b0b01a5d3ca4d70459b55b8b9b6762ffdab145486'
AND (
token = 'AUJ036wc/KNMZU4QbIkNufnNCH1h3zB2z47tCgQcNuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)