UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '00qQIRuoKPoVdCFc7Xrr4R33Z3LAPg1rtzz6guuBtL0=' 
WHERE 
  key_id = '5b1a7c3a7b81c609fac88aad8328f0d8e4a82550ce20e472b71a49d30e220953' 
  AND (
    token = '00qQIRuoKPoVdCFc7Xrr4R33Z3LAPg1rtzz6guuBtL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042