UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ecBws2eGrFoaWRS0ssYYCZ60WULeNuRaQxBKiSeBdsc=' 
WHERE 
  key_id = 'c1c716bac62e4dd711f0b510fed739634b4403ad28a592b8eeed6d2ee1a93f71' 
  AND (
    token = 'ecBws2eGrFoaWRS0ssYYCZ60WULeNuRaQxBKiSeBdsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016