UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p5XtV0P8lq2SkGuvtMnw4CgTddRECaY6A/rXpsY9B6o=' 
WHERE 
  key_id = 'f30b00bf024f84fc4c93663d29601d9329057ce8a7d6ac2bd3bd41dd808fba3c' 
  AND (
    token = 'p5XtV0P8lq2SkGuvtMnw4CgTddRECaY6A/rXpsY9B6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059