UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aNfzOnhEdWD6/Iq42OMlSp4TSqf9wtzDP7mm0+2Du6Q=' 
WHERE 
  key_id = 'a1a8920bcb2a89d6e261d7d5b588c24314cf23e48838bddf901047c73879c0fc' 
  AND (
    token = 'aNfzOnhEdWD6/Iq42OMlSp4TSqf9wtzDP7mm0+2Du6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039