UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+UGnxS876VMLSBf2sKTYUrkgLkOuhotGCjPOHG1BpWw='
WHERE
key_id = 'fed17ec0b4e39bbe351fdca5e6f19ad0bd90c2780c145ab57c71a3412cbbf927'
AND (
token = '+UGnxS876VMLSBf2sKTYUrkgLkOuhotGCjPOHG1BpWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)