UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2gm0WI4yfG2ZuFDJP8rCKT/ajW06QL3cNOLPUkFLlAI=' 
WHERE 
  key_id = 'f24d298b1c3e8e4b4ac0d22569864039a00a13d63a17ed35add64acb736c21c1' 
  AND (
    token = '2gm0WI4yfG2ZuFDJP8rCKT/ajW06QL3cNOLPUkFLlAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041