UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0fo0gjmvAQ5/ywd3M6prYblT1sMsOTrnmYhffYKhtXY='
WHERE
key_id = 'c6e7acfdcaa63cdb3b2b0518808bce201ce943035d85f28a732f337fea7074ad'
AND (
token = '0fo0gjmvAQ5/ywd3M6prYblT1sMsOTrnmYhffYKhtXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)