UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'scfJcNTOMaRojPEKDYwSWsL880IP9dvpIRER/cnaDhI='
WHERE
key_id = '89e48cad402f94370dc49169566a6550da7648ebbbeb0a9a928a099b7bc8d0bd'
AND (
token = 'scfJcNTOMaRojPEKDYwSWsL880IP9dvpIRER/cnaDhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)